package com.example.blogdemo1.common.config;

/*
 * @author zzr
 * @date: 2025/10/05  17:54
 * @description:
 */

import com.example.blogdemo1.common.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class ExceptionAdvice {
    @ExceptionHandler
    public Result handler(Exception e) {
        log.error("发生异常，e",e);
        return Result.fail(e.getMessage());
    }
}
